@include('Layout.header')
    <div class="page page-login">
        <div class="wrapper">
            <form action="/dologin" method="post">
                <h3 class="head">用户登录</h3>
                <div class="items">
                    <div class="item i1">如没有账号，请点此 <a href="/register">注册</a></div>
                    <div class="item">
                        <input  class="required " autocomplete="new-password" id="phone" name="username" type="text" placeholder="用户名" />
                    </div>
                    <input type="hidden" name="_token" id="token" value="{{ csrf_token()}}">
                    <div class="item">
                        <input class="required password" autocomplete="new-password"  id="pass" name="pass" type="password" placeholder="登录密码" />
                    </div>

                    <!-- <a href="../find-pass" ><div class="item i-find-pass">忘记密码?</div></a> -->
                    <div class="item i5">
                        <input type="submit" id="login"  value="立即登录" />
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script type="text/javascript" src="/static/lib/jquery.min.js"></script>
<script>

    $(function(){

        //   删除
        $('#login').on('click',function() {

            var username = $('#phone').val();
            var token = $('#token').val();
            var pass = $('#pass').val();

            $_this = $(this);
            $.ajax({
                url: '/dologin',          //  删除账号
                type: 'post',
                data: {
                    username: username,
                    _token: token,
                    pass: pass
                },
                timeout: 5000,
                dataType: 'json',
                success: function (data, textStatus, jqXHR) {
                    if (data.code == 0) {
                        self.location = '/user';
                    } else {
                        alert(data.msg);
                    }
                }
            })
        });
    });

</script>


@include('Layout.footer')
